﻿//Created by Action Script Viewer - http://www.buraks.com/asv
package Display.CollectionsUI {
    import org.aswing.*;
    import Classes.*;
    import Display.InventoryUI.*;
    import Display.aswingui.*;

    public class CollectionScrollingList extends InventoryScrollingList {

        public static const NUM_COLLECTION_ITEMS:int = 2;

        public function CollectionScrollingList(_arg1:Array, _arg2:Class, _arg3:int, _arg4:int=0, _arg5:int=2, _arg6:Boolean=false){
            super(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6);
        }
        override public function get numItems():int{
            return (NUM_COLLECTION_ITEMS);
        }
        override protected function initSize():void{
            m_scrollPane.setPreferredWidth(CollectionCell.COLLECTION_CELL_WIDTH);
        }
        override protected function prepare():void{
            var _local1:JPanel;
            var _local2:JPanel;
            if (!m_hideScrollButtons){
                _local1 = ASwingHelper.makeSoftBoxJPanelVertical(SoftBoxLayout.CENTER);
                _local1.append(leftBtn);
                _local1.append(ASwingHelper.verticalStrut(12));
                this.append(_local1);
                this.append(m_scrollPane);
                _local2 = ASwingHelper.makeSoftBoxJPanelVertical(SoftBoxLayout.CENTER);
                _local2.append(rightBtn);
                _local2.append(ASwingHelper.verticalStrut(12));
                this.append(_local2);
                this.append(ASwingHelper.horizontalStrut(8));
            } else {
                this.append(m_scrollPane);
            };
            ASwingHelper.prepare(this);
            m_initialized = true;
        }
        override public function invalidateData():void{
            var _local1:int;
            var _local2:CollectionCell;
            if (m_initialized){
                _local1 = 0;
                while (_local1 < m_data.length) {
                    _local2 = (m_dataList.getCellByIndex(_local1) as CollectionCell);
                    if (_local2 != null){
                        _local2.invalidateData();
                    };
                    _local1++;
                };
            };
        }
        override protected function get scrollingListWidth():Number{
            return (CollectionCell.COLLECTION_CELL_WIDTH);
        }
        override public function get currentItemName():String{
            var _local1:Collection = m_data[this.currentItem];
            return (_local1.name);
        }

    }
}//package Display.CollectionsUI 
